{% extends "base.html" %}
{% load i18n %}

{% block title %} {{course.name}} - Mr. Edu {%endblock%}

{% block section%}

	<p id="breadCrumbs">
		<a href="/mrEdu/{{userRole}}/classes">{% trans "[BREADCRUMB] My Classes" %}</a>
		<span class="hidden">&gt;</span>
		<span class="itemName">{{course.name}}</span>
	</p>
	
	{% if course %}
	<div class="colLeft">
		<h1>{{course.name}}</h1>
		
		<div class="scroller">
			<table>
				<caption class="hidden">{% trans "[TABLE] The list of students: for each one, the table visualizes the surname, the name and number of uploaded contents." %}</caption>
				<thead>
					<tr>
						<th>{% trans "[TABLE] Surname"%}</th>
						<th>{% trans "[TABLE] Name"%}</th>
						<th>{% trans "[TABLE] Uploaded contents"%}</th>
					</tr>
				</thead>
				<tbody>
					{% for s in students %}
					<tr>
						<td>{{s.surname}}</td>
						<td>{{s.name}}</td>
						<td>{{s.contents}}</td>
					</tr>
					{% endfor %}
				</tbody>
			</table>
		</div>
	</div>
	<div class="colRight">
		<h1>{% trans "[TITLE] Folders" %} <span class="button right"><a href="/mrEdu/{{userRole}}/class/{{course.id}}/collection/new">{% trans "[BUTTON] New folder" %}</a></span></h1>
		
		<div id="recentCollections">
			{% if collections %}
			<ul class="collectionS">
				{% for c in collections %}
				<li><a href="/mrEdu/{{userRole}}/collection/{{c.id}}/">
				{% if c.name|length > 12 %}
					{% for l in c.name|make_list|slice:":8" %}{{l}}{% endfor %} ...
					{% else %}
					{{c.name}}
					{% endif%}
				</a></li>
				{% endfor %}
			</ul>
			{% else %}
			<div id="feedback"><p class="message">{% trans "[MESSAGE] You didn't create any folder yet." %} <a href="/mrEdu/{{userRole}}/class/{{course.id}}/collection/new">{% trans "[MESSAGE] Create a folder" %}</a> {% trans "[MESSAGE] and enjoy!" %}</p></div>
			{% endif %}
		</div>
	</div>
	{% else %}
	<div id="feedback">
		<p class="message">{% trans "[MESSAGE] You don't have any class. Please contact the Administrator." %}</p>
	</div>
	{% endif %}
	
{%endblock%}